package org.vectrics.common.html;

public class JavaScriptMethod {
	private String methodName = null;
	private String methodParameters = null;
	private StringBuffer body = new StringBuffer();
	
	public JavaScriptMethod() {
		
	}

	
	public StringBuffer getBody() {
		return body;
	}


	public void setBody(StringBuffer body) {
		this.body = body;
	}


	public String getMethodName() {
		return methodName;
	}


	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}


	public String getMethodParameters() {
		return methodParameters;
	}


	public void setMethodParameters(String methodParameters) {
		this.methodParameters = methodParameters;
	}


	public void addLine(String line) {
		body.append(line + "\r\n");
	}
	
	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append(this.getMethodName());
		str.append("(");
		if (this.methodParameters != null)
			str.append(methodParameters);
		str.append(") {");
		str.append(this.body.toString());
		str.append("};\r\n\r\n");
		return(str.toString());
	}
}
